const app = getApp()
let DB = wx.cloud.database()
Page({
  data: {
    commentList: []
  },
  //去商品详情页
  goDetail(e) {
    wx.navigateTo({
      url: '/pages/detail/detail?goodid=' + e.currentTarget.dataset.goodid
    })
  },
  onLoad() {
    this.getMyCommentList();
  },

  //获取我的所有评论列表
  getMyCommentList() {
    let user = wx.getStorageSync('user')
    wx.request({
      url: 'http://localhost:8080/api/comment/myComment',
      method: 'POST',
      data: {
        action: 'user',
        userid: user.id
      },success:(res)=>{
                    this.setData({
                      commentList: res.data.data
            })
      }
    })


  },
})